
host=$1
disk=$2
journal_dev=$3

echo "host:$host disk:$disk"

#ceph-deploy disk list ${hos}t 


if [ -n "$journal_dev" ] 
then
    echo "$host $disk $journal_dev"
    ceph-deploy --overwrite-conf osd prepare ${host}:$disk:$journal_dev
    ceph-deploy --overwrite-conf osd activate ${host}:${disk}:$journal_dev
else
   ssh ${host}  systemctl restart systemd-udevd.service
   ssh ${host}  sgdisk -o $disk
   ceph-deploy  disk zap  ${host}:$disk

    ceph-deploy --overwrite-conf osd prepare ${host}:$disk
    ceph-deploy --overwrite-conf osd activate ${host}:${disk}1
fi

